/** @file message_dialog.cpp
 */
#include "message_dialog.h"
#include "string.h"

MessageDialog::MessageDialog(HWND parent, char *text):PopupDialog(parent)
{
    name ="MessageDialog";

    pLable =new Lable(this, text);

    setSize(100,40);
    
    setupGeometry();
}

void MessageDialog::setupGeometry()
{
    pButtonOK =new Button(this, "OK");
    pButtonOK->setPosition( 10, 20);
    pButtonCancel =new Button(this, "CANCEL");
    pButtonCancel->setPosition(40,20);
    pLable->setPosition(5,5);
}

void MessageDialog::draw(Rect *r)
{
    pDC->fillRect(rect.x0,rect.y0, rect.x1,rect.y1, 0x0);
    pDC->drawRect(rect.x0,rect.y0, rect.x1,rect.y1, 0x0F);

    pDC->dirty(max(r->x0,rect.x0), max(r->y0,rect.y0), min(r->x1,rect.x1), min(r->y1,rect.y1));
    Widget::draw(r);
}


int MessageDialog::eventHandler(HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam)
{
    switch(iMsg)
    {
    case MSG_SIGNAL:
        break;
    }
    
    return PopupDialog::eventHandler(hWnd, iMsg, wParam, lParam);
}

